/*
“Measuring Time Preferences in Large Surveys”

Bechtel, Michael M.
Jensen, Amalie
McAllister, Jordan H.
Scheve, Kenneth F. 

REPLICATION ARCHIVE 

********** DATA CITATION DISCLAIMER **************
Use of this replication archive (in full or in part) is subject to data citation requirements: Data Citation Synthesis Group: Joint Declaration of Data Citation Principles. Martone M. (ed.) San Diego CA: FORCE11; 2014 https://doi.org/10.25490/a97f-egyk
**************************************************
*/



version 16
capture log close
set more off
clear all

* Set folder here
global user="/Users/mbechtel/Desktop/Dropbox/Climate fairness/11 Replication Archives/03 Replication PSRM"

* Define folder and subolders
cd "$user" /* Set working directory */
global data="$user/02 Data" /* Set data directory */
global output="$user/03 Results" /* Set results directory */
log using "$user/03 Results/00 log file.smcl", replace

* The results are based on three different surveys (CTB Survey, Waterpipe Survey, Long-Term Public Policy Survey). Reflecting this strcutre, this code replicates the results in three main steps, one per survey.

*-----------------
* 1. CTB Survey
*-----------------
* Import and prepare variables
do "$user/01 Code/01-0 prep.do" /* import raw data */
do "$user/01 Code/01-1 prep ctb.do" /* prepare CTB variables and import payoff tables (instrument) */
do "$user/01 Code/01-2 est ind CTB.do" /* individual-level estimation of patience (and other CTB) paramters */
do "$user/01 Code/01-3 staircase.do" /* individual-level estimation of patience using staircase method */
do "$user/01 Code/01-4 merge.do" /* merging CTB and staircase-level patience and risk aversion measures */
do "$user/01 Code/01-5 gen main data.do" /* preparing CTB measures*/

* Results: Tables
do "$user/01 Code/01-6 Table 1.do" /* Table 1 results: not exported as table file */
do "$user/01 Code/01-6 Tables 3, A4-A7, A10-A11.do" /* Table 3 and Appendix Tables A4, A5, A6, A7, A10, A11 */
do "$user/01 Code/01-6 Table A1.do" /* Table A1 results */
do "$user/01 Code/01-6 Table A12.do" /* Table A12 results: not exported as table file */
do "$user/01 Code/01-6 Table A15.do" /* Table A15 Sociodemographic Predictors of Patience: Quantile Regressions */
do "$user/01 Code/01-6 Table A16.do" /* Table A16 Sociodemographic Predictors of Patience: OLS Estimates */
do "$user/01 Code/01-6 Table A17.do" /* Table A17 Sociodemographic Predictors of Patience: Quantile Regressions, Weighted Data*/
do "$user/01 Code/01-6 Table A18.do" /* Table A18 Sociodemographic Predictors of Binary Patience Measures: Weighted Data */
do "$user/01 Code/01-6 Table A19-CTB.do" /* Table A.19 CTB portion */  

* Results: Figures
do "$user/01 Code/01-7 Figure A2" /* Figure A2 */
do "$user/01 Code/01-7 Figure A3" /* Figure A3 */

*-----------------
* 2. Waterpipe Survey
*-----------------
* Table2, A2, A3, A14, A22, 
do "$user/01 Code/02-1 Tables 2, A2-A3.do"
do "$user/01 Code/02-1 Table A14.do" /* Table A14 Waterpipe Survey: Sociodemographics; not exported as table file */
do "$user/01 Code/02-1 Table A19-Water.do" /* Table A19 Waterpipe survey portion; not exported as table file */

*-----------------
* 3. Long-Term Public Policy Survey
*-----------------
* Run R code files included in the replication archive for replicating Tables A8, A9, A13

log close
exit
